<style src="./index.scss" lang="scss" scoped rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
    export default {
        mixins: [Vue.prototype.$vFN.Mixins.Base],
        components: {
            EditorTiptapWxtuwen: async () => Vue.extend(await Vue.prototype.$vFN.Components.Base.EditorTiptapWxtuwen()),
        },
        props: {
            // 使用者window实例 必定义
            appWindow: {
                type: Object,
                default: null,
            },
            // 一级栏目id
            value: {
                type: Object,
                default: null,
            },
            // 字数限制
            isWechat: {
                type: Number,
                default: 0,
            },

        },
        computed: {

        },

        data() {

            return {

                form: {
                    // 微信封面图片URL	
                    thumbUrl: "",
                    // 本地封面图片URL
                    localThumbUrl: "",
                    // 封面图片素材id
                    thumbMediaId: "",
                    // 是否显示封面 0否 1是
                    showCoverPic: 1,

                    // 微信内容
                    content: "",
                    // 本地内容
                    localContent: "",

                    // 多媒体素材对应关系
                    contentMatchLst: [],


                    // 标题
                    title: "",
                    // 作者
                    author: "",
                    // 摘要
                    digest: "",
                    // 原文地址
                    contentSourceUrl: "",
                }
            };
        },
        methods: {
            selectImage() {
                this.$vFN.Directives.SelectResourcesImage({
                    count: 1,
                    appWindow:this.appWindow,
                    mode: "wx",
                    onSuccess: (res) => {
                        console.error(res);
                        this.value.thumbMediaId = res.all.obj[0].id;
                        this.value.thumbUrl = res.all.obj[0].wechatUrl;
                        this.value.localThumbUrl = res.all.obj[0].albumUrl;
                    },
                });
            },
        },
        mounted() {},
        beforeCreate() {},
        watch: {

        },
    };
</script>